#!/bin/bash
#

vim_dir=~/.config/vim
[ ! -d $vim_dir ] &&  mkdir -p $vim_dir

if [ -e ~/.vimrc ]; then
    read -p  "~/.vimrc 存在，是否备份,y/n: " flag
    if [ $flag == "y" ]; then
	ln -s -S bak `pwd`/.vimrc ~/.vimrc
    else
        echo link to ~/.vimrc
        ln -sf `pwd`/.vimrc ~/.vimrc
    fi
fi

for i in `ls *.vim`; do
    ln -s `pwd`/$i $vim_dir/$i
done

cp -r `pwd`/colors $vim_dir/colors
cp -r `pwd`/plugin $vim_dir/plugin

